﻿using System;
using System.Collections.Generic;
using System.Linq;

using Sumen.Model.Model;

namespace Sumen.Business.Presenter.Category
{
    public class CustomerTypePresenter
    {

        public int Update(object pObjectValue, object pId)
        {
            throw new NotImplementedException();
        }

        public int Add(object pObjectValue)
        {
            throw new NotImplementedException();
        }

        public int Delete(object pObjectValue)
        {
            throw new NotImplementedException();
        }

        public ICollection<customer_type> GetAll()
        {
            using (sumenEntities objEntities = new sumenEntities())
            {
                if (ClsPublic.SYSTEM_DISPLAY_ACTIVED == "1")
                    return objEntities.customer_type.ToList();
                else
                    return objEntities.customer_type.Where(p => p.CusT_Actived == 1).ToList();
            }
        }

        public customer_type GetById(object pId)
        {
            using (sumenEntities objEntities = new sumenEntities())
            {
                int id = Convert.ToInt32(pId);
                return objEntities.customer_type.FirstOrDefault(p => p.CusT_ID == id);
            }
        }

        public ICollection<customer_type> GetByKey(object pValue)
        {
            throw new NotImplementedException();
        }

        public object GetScalar()
        {
            throw new NotImplementedException();
        }

    }
}
